package io.renren.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import io.renren.commons.mybatis.service.impl.CrudServiceImpl;
import io.renren.dao.AppointmentNotepadDao;
import io.renren.dto.AppointmentNotepadDTO;
import io.renren.entity.AppointmentNotepadEntity;
import io.renren.service.AppointmentNotepadService;
import org.apache.commons.lang3.StringUtils;
import org.springframework.stereotype.Service;

import java.util.Map;

/**
 * 预约记录
 *
 * @author liuyujun 384880231@qq.com
 * @since 3.0 2022-01-13
 */
@Service
public class AppointmentNotepadServiceImpl extends CrudServiceImpl<AppointmentNotepadDao, AppointmentNotepadEntity, AppointmentNotepadDTO> implements AppointmentNotepadService {

    @Override
    public QueryWrapper<AppointmentNotepadEntity> getWrapper(Map<String, Object> params){
        QueryWrapper<AppointmentNotepadEntity> wrapper = new QueryWrapper<>();

        String aid = (String)params.get("aid");
        wrapper.eq(StringUtils.isNotBlank(aid), "aid", aid);
        String contacts = (String)params.get("contacts");
        wrapper.like(StringUtils.isNotBlank(contacts), "contacts", contacts);
        String phone = (String)params.get("phone");
        wrapper.like(StringUtils.isNotBlank(phone), "phone", phone);

        return wrapper;
    }


}